<MDXHeader
  title="Number Field"
  description="A number input that allow users to input custom number entries with a keyboard."
  docs="https://kobalte.dev/docs/core/components/number-field"
/>

<ComponentPreview name="number-field-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx solidui-cli@latest add number-field
```

</TabsContent>

<TabsContent value="manual">
<Steps>

<Step>Install the following dependencies: </Step>

```bash
npm install @kobalte/core
```

<Step>Copy and paste the following code into your project: </Step>

<ComponentSource name="number-field" />

</Steps>
</TabsContent>

</Tabs>

## Usage

```tsx
import {
  NumberField,
  NumberFieldDecrementTrigger,
  NumberFieldGroup,
  NumberFieldIncrementTrigger,
  NumberFieldInput
} from "~/registry/ui/number-field"

export default function NumberFieldDemo() {
  return (
    <NumberField class="w-36" defaultValue={40}>
      <NumberFieldGroup>
        <NumberFieldInput />
        <NumberFieldIncrementTrigger />
        <NumberFieldDecrementTrigger />
      </NumberFieldGroup>
    </NumberField>
  )
}
```
